package com.shuda.business.channel.service;

import com.shuda.business.channel.entity.ChannelSource;
import com.shuda.business.channel.mapper.ChannelSourceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChannelSourceDbService {
    
    @Autowired
    private ChannelSourceMapper channelSourceMapper;
    
    public ChannelSource getById(Long id) {
        return channelSourceMapper.selectById(id);
    }
    
    public List<ChannelSource> getList() {
        return channelSourceMapper.selectList(null);
    }
    
    public boolean insert(ChannelSource channelSource) {
        return channelSourceMapper.insert(channelSource) > 0;
    }
    
    public boolean update(ChannelSource channelSource) {
        return channelSourceMapper.updateById(channelSource) > 0;
    }
    
    public boolean delete(Long id) {
        return channelSourceMapper.deleteById(id) > 0;
    }
}